package com.cuijq.ms.visitordesign.v5;

import java.util.HashMap;
import java.util.Map;

/**
 * @author by CuiJQ
 * @Classname ExtractorFactory
 * @Description ExtractorFactory Description
 * @Date 2021/5/30 23:37
 */
public class ExtractorFactory {

  private static final Map<ResourceFileType,Extractor> extractors = new HashMap<>();

  static {
    extractors.put(ResourceFileType.PDF, new PdfExtractor());
    extractors.put(ResourceFileType.PPT, new PPTExtractor());
    extractors.put(ResourceFileType.WORD, new WordExtractor());
  }

  public static Extractor getExtractor(ResourceFileType type) {
    return extractors.get(type);
  }
}
